<template>
  <SearchHeader @goBack="goBack" @goSearchList="goSearchList" />
  <RouterView />
</template>

<script setup>
import { defineComponent, onMounted, onBeforeUnmount } from 'vue'
import SearchHeader from '@/components/Search/SearchHeader.vue'
// import SearchIndex from '@/components/Search/SearchIndex.vue'
// import SearchIndex from '@/components/Search/SearchList.vue'
import { useRouter } from 'vue-router'
import { useAppStore } from '@/stores'

const search = defineComponent({
  name: 'Search',
  // 组件的其他选项...
})

const sStore = useAppStore()
let router = useRouter()
const goBack = () => {
  sStore.setTabbarStatus(true)
  console.log('goBack-router :>> ', router)
  // router.back()
  router.push({ name: 'Home' })
}
let goSearchList = () => {
  router.push({ name: 'list' })
}

onMounted(() => {
  sStore.setTabbarStatus(false)
})

onBeforeUnmount(() => {
  sStore.setTabbarStatus(true)
})
</script>
